home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / test / cmd-diff.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-07-07  |  979 b   |  22 lines  |  [TEXT/R*ch]

  1. #!/bin/sh
  2.  
  3. # This script extracts and compares the commands defined in the manual
  4. # to those defined in the source code.
  5.  
  6. grep DEF_CMD $1/../*/*cmd.def | sed -e 's/\\\\/\\/' | sed -e 's/^[^(]*(\([^,]*\), "\([^"]*\)".*$/\1 \2/' | sed -e "s/C('\(.\)')/C-\1/" -e "s/ *'\(.\)' /\1/" -e 's/   0  /0/' | grep -v '0 D' | sort | uniq >src.cmds
  7.  
  8. grep -h "^\`@code"  $1/../doc/play.texi $1/../doc/*chap.texi | sed -e 's/@@/@/'| sed -e 's/^\`@code{\(.\)}. @code{\([^}]*\)}.*$/\1 \2/' >doc.cmds1
  9.  
  10. grep -h "^@code{[^C]"    $1/../doc/play.texi $1/../doc/*chap.texi | sed -e 's/@@/@/' | sed -e 's/^@code{\([^C][^}]*\)}.*$/0 \1/' >doc.cmds2
  11.  
  12. grep -h "^@code{C-" $1/../doc/play.texi $1/../doc/*chap.texi | sed -e 's/@@/@/' | sed -e 's/^@code{\(C-.\)} @code{\([^}]*\)}.*$/\1 \2/' >doc.cmds3
  13.  
  14. cat doc.cmds[123] | sort | uniq >doc.cmds
  15.  
  16. echo "Differences between commands in reference manual and in source code:"
  17. echo "('<' - in documentation,  '>' - in sources)"
  18.  
  19. diff -w doc.cmds src.cmds
  20.  
  21. exit 0
  22.